/*
 * A JSR-168 portlet application for previewing unread
 * email messages.
 *
 * Copyright (C) 2007  San Joaquin Delta College
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 *
 */
package edu.deltacollege.portal.portlets.emailpreview;

import java.util.List;

/**
 * An entity object that abstracts the email account information
 * of a user. Currently, all the information retrieved is related
 * to the user's inbox.
 *
 * @author Andreas Christoforides
 * @see edu.deltacollege.portal.portlets.emailpreview.AccountInfoDAO
 *
 */
public class AccountInfo {

	private int unreadMessageCount;
	private int totalMessageCount;
	private int inspectedMessageCount;

	private List<EmailMessage> unreadMessages;

	/**
	 * Returns the number of unread messages in the user's inbox. The number
	 * of unread messages is bounded by the
	 * {@link #inspectedMessageCount inspectedMessageCount} attribute.
	 *
	 * @return The number of unread messages in the user's inbox.
	 */
	public int getUnreadMessageCount() {
		return this.unreadMessageCount;
	}

	/**
	 * Sets the number of unread messages in the user's inbox. The number
	 * of unread messages is bounded by the
	 * {@link #inspectedMessageCount inspectedMessageCount} attribute.
	 *
	 * @param unreadMessageCount The number of unread messages in
	 * the user's inbox.
	 */
	public void setUnreadMessageCount(int unreadMessageCount) {
		this.unreadMessageCount = unreadMessageCount;
	}

	/**
	 * Returns a list that contains a certain number of the most recent
	 * unread emails in the user's inbox. The number of unread messages
	 * is controlled by a property in <code>mail.properties</code>.
	 *
	 * @return A <code>List<EmailMessage></code> containing
	 * information about the most recent unread emails in the user's inbox.
	 */
	public List<EmailMessage> getUnreadMessages() {

		return this.unreadMessages;
	}

	/**
	 * Sets a list that contains a certain number of the most recent
	 * unread emails in the user's inbox. The number of unread messages
	 * is controlled by a property in <code>mail.properties</code>.
	 *
	 * @param unreadMessages A <code>List<EmailMessage></code> containing
	 * information about the most recent unread emails in the user's inbox.
	 */
	public void setUnreadMessages(List<EmailMessage> unreadMessages) {
		this.unreadMessages = unreadMessages;
	}

	/**
	 * Returns the number of total messages in the user's inbox. The number is not
	 * bounded by the value of the {@link #inspectedMessageCount inspectedMessageCount}
	 * attribute.
	 *
	 * @return The total number of messages in the user's inbox.
	 */
	public int getTotalMessageCount() {
		return this.totalMessageCount;
	}

	/**
	 * Sets the number of total messages in the user's inbox. The number is not
	 * bounded by the value of the {@link #inspectedMessageCount inspectedMessageCount}
	 * attribute.
	 *
	 * @param totalMessagecount The number of total messages in the user's inbox.
	 */
	public void setTotalMessageCount(int totalMessagecount) {
		this.totalMessageCount = totalMessagecount;
	}

	/**
	 * Returns the number of messages inspected to discover unread messages.
	 * The value is controlled by a property in <code>mail.properties</code>.
	 * If the property value is more than the total message count, the number
	 * of inspected messages is equal to the number of total messages.
	 *
	 * @return The number of messages inspected to discover unread messages.
	 */
	public int getInspectedMessageCount() {
		return this.inspectedMessageCount;
	}

	/**
	 * Sets the number of messages inspected to discover unread messages.
	 * The value is controlled by a property in <code>mail.properties</code>.
	 * If the property value is more than the total message count, the number
	 * of inspected messages is equal to the number of total messages.
	 *
	 * @param inspectedMessageCount The number of messages inspected to discover
	 * unread messages.
	 */
	public void setInspectedMessageCount(int inspectedMessageCount) {
		this.inspectedMessageCount = inspectedMessageCount;
	}
}
